package com.android.support.jhf.handlerui;

import java.lang.ref.WeakReference;

import com.android.support.jhf.handlerui.widget.CustomToast;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.widget.Toast;

/**
 * 用handler处理UI界面Toast
 * 
 * @author hongfeijia
 * 
 */
public class HandlerToastUI {

	private HandlerToastUI(Context context) {
	}

	public static void getHandlerToastUI(final Context context,
			final String messageString) {

		HandlerPostUI.getHandlerPostUI(new Runnable() {

			@Override
			public void run() {
				CustomToast.makeText(context, messageString, Toast.LENGTH_SHORT).show();
			}
		});

	}

	public static void getHandlerToastUIColor(final Context context,
			final String messageString, final int textColor) {

		HandlerPostUI.getHandlerPostUI(new Runnable() {

			@Override
			public void run() {
				CustomToast.makeTextColor(context, messageString,Toast.LENGTH_SHORT,context.getResources().getColor(textColor)).show();
			}
		});

	}

	public static void getHandlerToastUI(final Context context,
			final String messageString, final int duration) {
		HandlerPostUI.getHandlerPostUI(new Runnable() {

			@Override
			public void run() {
				CustomToast.makeText(context, messageString, duration).show();
			}
		});
	}

}
